

import unittest
from handle.login_handle import LoginHandle
from modules.user_loging import CommonalityUserMethod



class  SendCode(unittest.TestCase):
       '''发送验证码 例子'''
       @classmethod
       def setUpClass(cls):
           cls.log_obj  = LoginHandle()
           cls.user_obj = CommonalityUserMethod()
           cls.phone    = cls.user_obj.dict_user[cls.user_obj.username]['phone']#读取用户手机号码

       #例子
       def test_01_get_colde_phone_null(self):
           '''手机号码为空获取验证码'''
           rest =self.log_obj.get_sendcode() #根据自己项目传递参数
           self.assertEqual(rest['Msg'],"手机号码不正确")


       def test_02_login_succeed(self):
           '''登录成功后将token保持到本地'''
           rest=self.log_obj.login_sucess(self.phone)


       def test_03_mycenter(self):
           '''携带登录成功后的token访问个人中心'''
           rest=self.log_obj.intocentent()

       def test_03_resetpwd(self):
           '''重置密码'''
           self.log_obj.resetpwd(self.phone,"123456")


       @classmethod
       def tearDownClass(cls):
           pass



if __name__ == '__main__':

      unittest.main()
